<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>axios手写</title>
</head>
<body>
	<button>post->data</button>
</body>
<script src="./node_modules/axios/dist/axios.js"></script>
<script type="module">
	// 取消请求
	// 拦截
	import axios from "./index.js";
	// axios.defaults可以控制配置对象
	axios.defaults.timeout = 1000;
	// axios.defaults.headers = {
	// 	username:"wangwu",
	// 	age:100
	// }
	// axios.defaults.baseURL = "http://127.0.0.1";
	const btn = document.querySelector("button");
	btn.onclick = function(){
		const result = axios({
			url:"/info",
			timeout:2000
		});
		console.log(11111,result);
	}
</script>
</html>